import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 引入echarts
import *as echarts from 'echarts'
import axios from 'axios'
// 导入全局样式
import './assets/css/globel.css'


Vue.prototype.$echarts = echarts

// 配置请求的根路径
axios.defaults.baseURL = 'http://127.0.0.1:8000'
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.localStorage.getItem('token')

  // 在最后必须 return config
  return config
})
Vue.prototype.$http = axios

// element-ui引入
Vue.use(ElementUI)
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
